using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Countries")]
	[Serializable]
    public class Country : DBO<Country>
    {
		#region Fields
		
		private int? _IdCountry;
		private string _CountryName;
		private string _Icon;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Country()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdCountry 
		/// </summary>
		/// <param name="IdCountry">The IdCountry</param>
		public Country(int? IdCountry )
		{
			this.IdCountry = IdCountry;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdCountry">Sets int? value for IdCountry</param>
		/// <param name="CountryName">Sets string value for CountryName</param>
		/// <param name="Icon">Sets string value for Icon</param>
		public Country(int? idCountry, string countryName, string icon)
		{
			this.IdCountry = idCountry;
			this.CountryName = countryName;
			this.Icon = icon;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdCountry
		/// </summary>
		[ColumnAttribute("IdCountry", SqlDbType.Int , 4 , true, true, false)]
		public int? IdCountry
		{
			set
			{
				this._IdCountry = value;
			}
			get
			{
				return this._IdCountry;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for CountryName
		/// </summary>
		[ColumnAttribute("CountryName", SqlDbType.NVarChar , 100 , false, false, true)]
		public string CountryName
		{
			set
			{
				this._CountryName = value;
			}
			get
			{
				return this._CountryName;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Icon
		/// </summary>
		[ColumnAttribute("Icon", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Icon
		{
			set
			{
				this._Icon = value;
			}
			get
			{
				return this._Icon;
			}
		}
		
		
		/// <summary>
		/// Get a list Club of current Country object base on IdCountry
		/// </summary>
		public List<Club> ClubListForIdCountry
		{
			get
			{
				if (this.IdCountry == null)
					return null;
				Club condition = new Club();
				condition.IdCountry = this.IdCountry;
				return ClubController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Player of current Country object base on IdCountry
		/// </summary>
		public List<Player> PlayerListForIdCountry
		{
			get
			{
				if (this.IdCountry == null)
					return null;
				Player condition = new Player();
				condition.IdCountry = this.IdCountry;
				return PlayerController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list User of current Country object base on IdCountry
		/// </summary>
		public List<User> UserListForIdCountry
		{
			get
			{
				if (this.IdCountry == null)
					return null;
				User condition = new User();
				condition.IdCountry = this.IdCountry;
				return UserController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdCountry]
            /// </summary>
            public string IdCountry
            {
                get
                {
                    return "IdCountry";
                }
            }
            /// <summary>
            /// Get the name of column [CountryName]
            /// </summary>
            public string CountryName
            {
                get
                {
                    return "CountryName";
                }
            }
            /// <summary>
            /// Get the name of column [Icon]
            /// </summary>
            public string Icon
            {
                get
                {
                    return "Icon";
                }
            }
        }
        #endregion
    }
}
